This application is based on and incorporates herein by reference Japanese Patent Applications No. 2002-6057 filed on Jan. 15, 2002 and No. 2002-329588 filed on Nov. 13, 2002.
The present invention relates to an electronic control system equipped with floating point processing function, in which each computation result is replaced with a default value for expediting the floating point processing when it is determined to be xe2x80x98non-numeralxe2x80x99 or xe2x80x98infinity.xe2x80x99
Recent electronic control units (ECUs) for vehicles or the like are equipped with floating point processing units (FPUs). Use of the FPU enables computation of a floating point mode datum to obtain a higher precision computation result in comparison with use of a fixed point mode datum.
The floating point computation is well known and its datum format is specified in various standards. For instance, a datum format of a single-precision floating point mode compliant with IEEE 754 is composed of a 1-bit sign part, 8-bit exponent part, and 23-bit mantissa part. The total four byte datum possesses a seven digit resolution. The floating point mode datum can represent, as a xe2x80x98non-numeral,xe2x80x99 a computation result that cannot be represented as a numeral such as a xe2x80x980/0xe2x80x99 and xe2x80x98+∞-∞.xe2x80x99 For instance, in the above standard, if a datum has a mantissa part of other than xe2x80x980xe2x80x99 and an exponent part of all eight bits to be xe2x80x981xe2x80x99, the datum is treated as a xe2x80x98non-numeral.xe2x80x99 This kind of xe2x80x98non-numeralxe2x80x99 datum format may appear due to noise. Namely, when the noise forces all the exponent part to be changed to xe2x80x981xe2x80x99 with the mantissa part being other than xe2x80x980xe2x80x99, the datum is treated as a xe2x80x98non-numeral.xe2x80x99
Once the xe2x80x98non-numeralxe2x80x99 appears, a computation result using the xe2x80x98non-numeralxe2x80x99 naturally becomes xe2x80x98non-numeral.xe2x80x99 The xe2x80x98non-numeralxe2x80x99 must be therefore rewritten to a normal value. To solve this issue, the following two well-known methods are used.
Method (1): An entire area storing floating point mode data are searched for a xe2x80x98non-numeralxe2x80x99 using timer interruption and a default value is substituted for the xe2x80x98non-numeralxe2x80x99 when the xe2x80x98non-numeralxe2x80x99 is found.
Method (2): Similarly to the above method (1), an entire area storing floating point mode data are searched for a xe2x80x98non-numeralxe2x80x99 and a CPU is reset to initialize all the floating point mode data using an initializing routine when the xe2x80x98non-numeralxe2x80x99 is found.
The above method (1) adversely affects a memory area. Specifically, reasons will be explained by referring to the following computation types.
Computation (1): A+Bxe2x86x92C, where the sum of A and B is substituted for C.
When a computation result C becomes xe2x80x98non-numeral,xe2x80x99 other computation results using C become xe2x80x98non-numeral.xe2x80x99 However, when neither A nor B becomes xe2x80x98non-numeralxe2x80x99 thereafter, C returns to a normal numeral in the following computation. Hence, C and a computation result using C naturally return to the normal value for a short interval.
Computation (2): A+Bxe2x86x92A, where the sum of A and B is substituted for A.
When a computation result A becomes xe2x80x98non-numeral,xe2x80x99 other computation results using A become xe2x80x98non-numeral.xe2x80x99 Here, in a subsequent computation using A, a result thereby becomes xe2x80x98non-numeralxe2x80x99 and never returns to a normal value. Hence, A and a computation result using A never returns to the normal value.
As explained in the computation (2), where a preceding result is used for a current computation, appearance of a xe2x80x98non-numeralxe2x80x99 poses issues on the computation.
The method (1) that substitutes a default value involves a sizable memory area for storing default values of floating point mode data to be substituted for xe2x80x98non-numeralxe2x80x99 computation results. The default values must be prepared and stored even for computation results that will naturally return to the normal values in the computation (1).
The method (2) that resets a CPU adversely affects reliability of controlling a system due to suspending operation of a running system even if it is suspended for any short period.
The above issues result from not only a xe2x80x98non-numeralxe2x80x99 but also an xe2x80x98infinity.xe2x80x99 For instance, in the IEEE 754 specification, if a four byte datum has a mantissa part to be xe2x80x980xe2x80x99 and an exponent part of all eight bits to be xe2x80x981xe2x80x99, the datum is treated as an xe2x80x98infinity.xe2x80x99
It is an object of the present invention to provide an electronic control system capable of shortly returning a non-numeral or an infinity value of a floating point mode datum to a normal value.
To achieve the above and other objects, an electronic control system is programmed as follows: Repetitive computation is executed in the control program. In the computation, a floating point mode datum is used and a preceding computation result of the floating point mode datum is used for computing a current computation result. Whether the computation result is non-numeral is determined. When the computation result is determined to be non-numeral, a default value is substituted for the computation result of the non-numeral.
In one embodiment, whether a computation result is infinity is determined. When the result is determined to be infinity, a default value is substituted for the computation result of the infinity value.
The above processing enables the electronic control system to return a non-numeral or an infinity value of a floating point mode datum to a normal value with no impact on a memory area and no suspension of operation of a running system. This thereby ensures high reliability on controlling the system.